home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
acctg
/
dbbills
/
postclt.prg
< prev
next >
Wrap
Text File
|
1986-11-11
|
3KB
|
81 lines
*--[ postclt.prg ]-- post tasks to client records and age clt balances
SET PROCEDURE TO procfile
SELECT 1
USE client INDEX cltcode ALIAS clt
IF MONTH(LUPDATE())=MONTH(DATE())
CLEAR
SET COLOR TO W*+
@ 12,15 SAY "CLIENT BALANCES HAVE ALREADY BEEN POSTED THIS MONTH"
SET COLOR TO W
?
?
WAIT " PRESS RETURN"
CLEAR
RETURN
ENDIF
SELECT 2
USE taskunit INDEX taskdate ALIAS task
ok=.F.
DO WHILE .NOT. ok
CLEAR
start_date=CTOD(STR(MONTH(DATE()),2,0)+"/01/"+SUBSTR(STR(YEAR(DATE()),4,0),3,2))
end_date=CTOD(STR(MONTH(DATE())+1,2,0)+"/01/"+SUBSTR(STR(YEAR(DATE()),4,0),3,2))
m_client=101
end_clt=999
@ 16,15 SAY "ENTER STARTING DATE FOR REPORT "
@ 16,COL() GET start_date PICTURE "@D"
@ 17,15 SAY "ENTER ENDING DATE FOR REPORT "
@ 17,COL() GET end_date PICTURE "@D"
READ
SET COLOR TO W+*
@ 23,15 SAY "ARE THE POSTING PARAMETERS CORRECT [ ]"
SET COLOR TO W
@ 23,COL()-2 GET ok PICTURE "@L"
READ
ENDDO WHILE .NOT. ok
STORE 0 TO total_fee,fee
SELECT clt
CLEAR
SET COLOR TO W+
? " TENNESSEE DATA CONSULTING STATUS OF ACCOUNTS FOR "+CMONTH(start_date)
SET COLOR TO W
? "==========================================================================="
? "CLIENT NAME CURRENT OVER_30 OVER_60 OVER_90 TOTAL "
? "------------------------- --------- --------- --------- --------- ---------"
DO WHILE .NOT. EOF()
fee=0
DO get_task
m_client=c_code
SELECT task
DO WHILE c_code=m_client
* task has already been posted to client
IF post_clt
SKIP
IF EOF()
EXIT
ENDIF EOF()
LOOP
ENDIF post_clt
fee=IIF(charge,fee+clt->rate*hours,fee)
REPLACE post_clt WITH .T.
SKIP
ENDDO WHILE c_code=m_client
SELECT clt
REPLACE over_90 WITH over_90+over_60,over_60 WITH over_30,over_30 WITH current,current WITH fee
REPLACE yr_to_date WITH yr_to_date+fee
total_fee=total_fee+fee
? SUBSTR(c_name,1,25)+STR(current,10,2)+STR(over_30,10,2)+STR(over_60,10,2)+STR(over_90,10,2)+STR(current+over_30+over_60+over_90,10,2)
fee=0
SKIP
m_client=c_code
ENDDO WHILE .NOT. EOF()
SUM current,over_30,over_60,over_90 TO s_cur,s_30,s_60,s_90
? "------------------------- --------- --------- --------- --------- ---------"
? " "+STR(s_cur,10,2)+STR(s_30,10,2)+STR(s_60,10,2)+STR(s_90,10,2)+STR(s_cur+s_30+s_60+s_90,10,2)
? " ========= ========= ========= ========= ========="
?
?
WAIT " PRESS RETURN AFTER READING SCREEN"
CLOSE PROCEDURE
RETURN